<?php
/**
 * VInstallazione.php
 * 
 * @author mw
 * @package View
 *
 */
/**
 * VInstallazione
 * 
 * @author mw
 * @package View
 *
 */
class VInstallazione extends VView {
	/**
	 * Costruttore 
	 */
	public function __construct(){
		parent::__construct();
	}
	/**
	 * innodbError
	 */
	public function innodbError(){
		$this->setPage('install/innodbErr.tpl');
		$this->display();
	}
	/**
	 * end
	 */
	public function end() {
		$this->setPage('install/end.tpl');
		$this->display();
	}
	/**
	 * socialForm
	 */
	public function socialForm() {
		$this->setPage('install/formSocial.tpl');
		$this->display();
	}
	/**
	 * confSocialCreated
	 */
	public function confSocialCreated() {
		$this->setPage('install/socialCreated.tpl');
		$this->display();
	}
	/**
	 * getDatiAdmin
	 * 
	 * @return mixed
	 */
	public function getDatiAdmin(){
		$dati_richiesti=array('username','password','con_password','email','nome','cognome');
		foreach ($dati_richiesti as $dato) {
			if (isset($_REQUEST[$dato])){
				$dati[$dato]=$_REQUEST[$dato];
			}else{
				return false;
			}
		}
		return $dati;
	}
	/**
	 * getDatiSocial
	 * 
	 * @return mixed
	 */
	public function getDatiSocial(){
		$dati_richiesti=array('fb_app_id','fb_app_secret','url','email-noreply','email-admin');
		foreach ($dati_richiesti as $dato) {
			if (isset($_REQUEST[$dato])){
				$dati[$dato]=$_REQUEST[$dato];
			}else{
				return false;
			}
		}
		return $dati;
	}
	/**
	 * socialCreated 
	 */
	public function socialCreated(){
		$this->setPage('install/socialCreated.tpl');
		$this->display();
	}
	/**
	 * erroreDB
	 * 
	 * @param string $msg
	 */
	public function erroreDB($msg){
		$this->assign('msg',$msg);
		$this->setPage('install/erroreDB.tpl');
		$this->display();
	}
	/**
	 * formAdmin
	 */
	public function formAdmin() {
		$this->setPage('install/formAdmin.tpl');
		$this->display();
	}
	/**
	 * confDbCreated 
	 */
	public function confDbCreated() {
		$this->setPage('install/confDbCreated.tpl');
		$this->display();
	}
	/**
	 * errorFolders
	 * @param string $folder
	 */
	public function errorFolders($folder){
		
		$this->assign('folder',$folder);
		$this->setPage('install/errFold.tpl');
		$this->display();
		
	}
	/**
	 * fase1
	 */
	public function fase1() {
		$this->setPage('install/fase1.tpl');
		$this->display();
	}
	/**
	 * getDatiFase1
	 * 
	 * 
	 */
	public function getDatiFase1() {
		$dati_richiesti=array('host','user','pass','nome');
		$d = $_REQUEST['db'];
		foreach ($dati_richiesti as $dato) {
			if (isset($d[$dato])){
				$dati[$dato]=$d[$dato];
			}else{
				return false;
			}
		}
		return $dati;
	}
	
	/**
	 * Db
	 */
	public function populatingDB() {
		$this->setPage('install/populatingDB.tpl');
		$this->display();
	}
	
	
	
}